package cn.tedu.m1;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer {
    @Autowired
    private AmqpTemplate amqpTemplate;

    // 需要手动调用
    public void send() {
        amqpTemplate.convertAndSend("helloworld", "Hello world!");
    }
}
